import os

def gen_struct_content(dir):
    file = os.listdir(dir)

    get_name = lambda x: x.split('.')[0]  # 获得json文件名
    filenames = [get_name(name) for name in file]


    # 这一步满足了matlab的路径设置，是D:\matlabwork\VIFB\util中红外和可见光源图像设置
    for fname in filenames:  # 读取每个文件
        print(f"struct('name',{repr(fname)},'path',fileDir,'ext','png')",end=',')

if __name__ == '__main__':
    # 生成D:\matlabwork\VIFB\util中的红外和可见光路径！
    # dir = "D:\cycleFusion-project\dataset-1444\msrs_c1\ir"
    # dir = "D:\cycleFusion-project\dataset-1444\msrs-113\ir"
    dir = "D:\Datasets\msrs1444\ir"
    gen_struct_content(dir)